package com.k2data.k2app.service;

import com.k2data.k2app.domain.SysSms;
import com.k2data.k2app.exception.K2ResponseException;
import com.k2data.k2app.mapper.SysSmsMapper;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author lidong 17-3-6.
 */
@Log4j2
@Service
public class SysSmsService {

    private final SysSmsMapper sysSmsMapper;

    @Autowired
    public SysSmsService(SysSmsMapper sysSmsMapper) {
        this.sysSmsMapper = sysSmsMapper;
    }

    @Transactional
    public int insert(SysSms sysSms)  throws K2ResponseException {
        //TODO :login user
        sysSms.setCreateBy("");
        sysSms.setUpdateBy("");
        int num = sysSmsMapper.insertSelective(sysSms);
        return num;
    }

}
